package com.it.travel.dao;

import com.it.travel.pojo.Favorite;
import com.it.travel.pojo.Route;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FavoriteDao {

    /**
     *
     * @param uid 用户id
     * @param rid 查询详情路线id
     * @return
     */
    Favorite isFavoriteByRid(@Param("uid") int uid,@Param("rid") Integer rid);

    /**
     * 给路线表和用户表的中间表添加对应的数据
     * @param rid 路线id
     * @param uid 用户id
     * @return
     */
    Integer addFavorite(@Param("rid") Integer rid,@Param("uid") Integer uid);


    /**
     * 我的收藏展示
     * @param uid
     * @return
     */
    List<Favorite> findFavoriteByPage(@Param("uid") Integer uid);
}
